<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<style>
			#out {
				width: 200px;
				height: 200px;
				background-color: skyblue;
			}
			#inner {
				width: 100px;
				height: 100px;
				background-color: slateblue;
			}
		</style>
	</head>
	<body>
		<div id="out">
			<div id="inner"></div>
		</div>
	</body>
	<script>
		document.body.addEventListener('click', e => {
			switch (e.target.id) {
				case 'out':
					console.log('点到outer上了')
					break
				case 'inner':
					console.log('点到inner上了')
					break
				default:
					console.log('啥也不是！！！')
			}
		})
	</script>
</html>
